package org.wolfengi.handler.entity;

import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapreduce.lib.db.DBWritable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Author: wolfengi
 * @Description: ${TODO}
 * @Date: Created in 10:13 2020/5/19
 * @Modified By:
 */
public class TableOperForShipFalut implements Writable, DBWritable {

    private String fault;
    private int count;

    public TableOperForShipFalut(String fault, int count) {
        this.fault = fault;
        this.count = count;
    }

    @Override
    public void readFields(DataInput in) throws IOException {
    }

    @Override
    public void readFields(ResultSet rs) throws SQLException {
        this.fault = rs.getString(1);
        this.count = rs.getInt(2);
    }

    @Override
    public void write(DataOutput out) throws IOException {
    }

    @Override
    public void write(PreparedStatement ps) throws SQLException {
        ps.setString(1, this.fault);
        ps.setInt(2, this.count);
    }


}
